import java.io.IOException;
import java.net.MalformedURLException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class WebViewUtils {

	public static final String HTTPHOST = "http://news.xaufe.edu.cn/";

	public static String handle(String resp) throws MalformedURLException, IOException {
		Document s = Jsoup.parse((resp));
		Elements e = s.select("div#nw_left");
		Elements pngs = e.select("img[src]");
		for (Element element : pngs) {
			
			String imgUrl = element.attr("src");
			if (imgUrl.trim().startsWith("/")) {
				imgUrl = HTTPHOST + imgUrl;
				element.attr("src", imgUrl);
			}
		}
		return e.toString();

	}
	
	
	public static String getSub(String resp) throws MalformedURLException, IOException
	{
		Document s = Jsoup.parse(resp);
        String url="http://news.xaufe.edu.cn/Html/?4080.html";
	   url=Http.get(url);
      //  return s.select("meta[name='description']").attr("content");
		return s.select("div#web2l").toString();
		
	}
	public static void main(String args[])
	{
		String url="http://news.xaufe.edu.cn/Html/?4080.html";
		try {
			url=Http.get(url);
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			System.out.println(getSub((url)));
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
